<template>
    <div>
          <div>
            <el-tree
              ref='tree'
              class="filter-tree"
              :data="data"
              :props="defaultProps"
              default-expand-all
              :filter-node-method='filterNode'
              @node-click = 'change'
            />

          </div>
    </div>
</template>

<script>

export default {
    props:['data'],
    data() {
        return {
            filterText:'',
            
            defaultProps: {
            children: 'children',
            label: 'label',
        },
        }
    },
    methods: {
        
        change(data){
            // 选中元素的code
            console.log(data.code)
            this.$emit('changepid',data.code)
        }
    },
    created() {
        
    }
}
</script>

<style scoped>
.t1{
    width: 250%;
    height: 150%;
    border: 1px solid;
}
.s1{
    color: cornflowerblue;
}
</style>
